<template>
  <div class="hamburger-container" @click="handleToggle">
    <svg-icon :icon="isOpen"></svg-icon>
  </div>

</template>

<script setup>
import {computed} from 'vue';
import {useStore} from 'vuex';
const store = useStore();
const handleToggle = () => {
  store.commit('app/set_sidebarOpened');
};
const isOpen = computed(()=>store.getters.sidebarOpened ? 'hamburger-opened' : 'hamburger-closed');
</script>

<style scoped lang="scss">
.hamburger-container{
  float: left;
  width: 46px;
  text-align: center;
  line-height: 50px;
  cursor: pointer;
  transition: background-color .5s;
  user-select: none;
  &:hover{
    background-color: rgba(0,0,0,.1);
  }
}
</style>